package com.his.controller;

import com.his.entity.NonDrugItemRecord;
import com.his.entity.ResponseResult;
import com.his.service.ITechnologyService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@RestController
@RequestMapping("/technology")
public class TechnologyController {

    @Resource
    private ITechnologyService service;

    @PostMapping("refresh")
    public ResponseResult refresh() {
        return service.refresh();
    }

    @PostMapping("register")
    public ResponseResult register(NonDrugItemRecord nonDrugItemRecord) {
        return service.register(nonDrugItemRecord);
    }

    @PostMapping("upload")
    public ResponseResult upload(@RequestParam("uploadFile") MultipartFile file) {
        System.out.println(file.getOriginalFilename());
//        System.out.println(str);

        return new ResponseResult(201, "good");
    }

}
